import java.util.Arrays;

public class Maxnum {


    public static int[] test(int[] elem,int target){
        Arrays.sort(elem);
        int left = 0;
        int right = elem.length - 1;
        int[] cur = new int[2];
        while (left != right){
            if (elem[left] + elem[right] <target){
                left ++;
            }
            if (elem[left] + elem[right] >target){
                right--;
            }
            if (elem[left] + elem[right] == target){
                cur = new int[]{left,right};
                break;
            }
        }
        return cur;
    }
}
